label: Remove some unneeded conditionals
authorTimm Bäder <mail@baedert.org>
Wed, 13 Jan 2016 18:07:20 +0000 (19:07 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 14 Jan 2016 15:02:12 +0000 (16:02 +0100)
We are never passing NULL here.

gtk/gtklabel.c

index 7efb7499c1029b83cf7fdd3991cb51d07dd2b900..9d13def205bc54c1f00cc9dc0d450daa48486044 100644 (file)
@@ -4584,26 +4584,16 @@ window_to_layout_coords (GtkLabel *label,
 {
   GtkAllocation allocation;
   gint lx, ly;
-  GtkWidget *widget;
 
-  widget = GTK_WIDGET (label);
-  
   /* get layout location in widget->window coords */
   get_layout_location (label, &lx, &ly);
+  gtk_widget_get_allocation (GTK_WIDGET (label), &allocation);
 
-  gtk_widget_get_allocation (widget, &allocation);
+  *x += allocation.x; /* go to widget->window */
+  *x -= lx;                   /* go to layout */
 
-  if (x)
-    {
-      *x += allocation.x; /* go to widget->window */
-      *x -= lx;                   /* go to layout */
-    }
-
-  if (y)
-    {
-      *y += allocation.y; /* go to widget->window */
-      *y -= ly;                   /* go to layout */
-    }
+  *y += allocation.y; /* go to widget->window */
+  *y -= ly;                   /* go to layout */
 }
 
 static void
@@ -4612,26 +4602,17 @@ layout_to_window_coords (GtkLabel *label,
                          gint     *y)
 {
   gint lx, ly;
-  GtkWidget *widget;
   GtkAllocation allocation;
 
-  widget = GTK_WIDGET (label);
-  
   /* get layout location in widget->window coords */
   get_layout_location (label, &lx, &ly);
-  gtk_widget_get_allocation (widget, &allocation);
+  gtk_widget_get_allocation (GTK_WIDGET (label), &allocation);
 
-  if (x)
-    {
-      *x += lx;           /* go to widget->window */
-      *x -= allocation.x; /* go to selection window */
-    }
+  *x += lx;           /* go to widget->window */
+  *x -= allocation.x; /* go to selection window */
 
-  if (y)
-    {
-      *y += ly;           /* go to widget->window */
-      *y -= allocation.y; /* go to selection window */
-    }
+  *y += ly;           /* go to widget->window */
+  *y -= allocation.y; /* go to selection window */
 }
 
 static gboolean